<template>
	<view class="settled_container">
		<view class="settled_item" v-if="list.length>0" v-for="(item,index) in list" :Key="index">
			<view class="settled_top">
				<view class="settled_left">
					<image src="../../static/settled/house.png" mode=""></image>
					<text class="shanZhuang">{{item.shop.title}}</text>
				</view>
				<view class="finish">
					已消费
				</view>
			</view>
			<view class="settled_center">
				<image src="../../static/index/logo.png" mode=""></image>
				<view class="induc">
					<view class="house_name">
						1间，豪华大床房
					</view>
					<view class="house_time">
						入住时间{{item.create_time}}
					</view>
					<!-- <view class="house_yu">
						剩余权益：<text style="color: #06923D;">52天</text>
					</view> -->
				</view>
			</view>
		</view>
		<view class="no" v-if="list.length==0">
			<image src="../../static/task.png" mode=""></image>
		</view>
	</view>
</template>

<script>
	import{rzjl}from"../../api/user.js"
	export default{
		data(){
			return{
				list:[],
				id:null,
				num:1
			}
		},
		onLoad(e) {
			this.id=e.id
			this.getlist()
		},
		onReachBottom() {
			this.getlist()
		},
		methods:{
			async getlist(){
				let res=await this.ipost(rzjl,{user_id:uni.getStorageSync("userInfo").id,page:this.num})
				console.log(res)
				this.list=[...this.list,...res.data]
				this.num++
			}
		}
	}
</script>

<style lang="scss" scoped>
	.no{
		width: 690rpx;
		height: 70vh;
		display: flex;
		justify-content: center;
		align-items: center;
		flex-direction: column;
		image{
			width: 450rpx;
			height: 300rpx;
		}
	}
	page{
		background: #F1F1F1;
		opacity: 1;
	}
	.settled_container{
		padding: 0 30rpx;
		.settled_item{
			width: 690rpx;
			height: 273rpx;
			background: #FFFFFF;
			opacity: 1;
			border-radius: 8rpx;
			margin-top: 30rpx;
			padding: 0 30rpx;
			.settled_top{
				height: 40rpx;
				line-height: 40rpx;
				display: flex;
				justify-content: space-between;
				padding-top: 20rpx;
				.settled_left{
					image{
						width: 40rpx;
						height: 40rpx;
						vertical-align: middle;
					}
					.shanZhuang{
						font-size: 28rpx;
						font-family: PingFang SC;
						font-weight: 400;
						color: #333333;
						opacity: 1;
						margin-left: 10rpx;
					}
				}
				.finish{
					font-size: 24rpx;
					font-family: PingFang SC;
					font-weight: 400;
					color: #06923D;
					opacity: 1;
				}
			}
			.settled_center{
				display: flex;
				margin-top: 40rpx;
				image{
					width: 163rpx;
					height: 163rpx;
					background: rgba(0, 0, 0, 0);
					opacity: 1;
					border-radius: 8px;
				}
				.induc{
					margin-left: 20rpx;
					.house_name{
						font-size: 26rpx;
						font-family: PingFang SC;
						font-weight: 400;
						color: #666666;
						opacity: 1;
					}
					.house_time{
						font-size: 24rpx;
						font-family: PingFang SC;
						font-weight: 400;
						color: #666666;
						opacity: 1;
						margin-top: 6rpx;
					}
					.house_yu{
						font-size: 24rpx;
						font-family: PingFang SC;
						font-weight: 400;
						color: #666666;
						opacity: 1;
						margin-top: 51rpx;
					}
				}
			}
		}
	}
</style>
